package com.zfl.pojo;

import com.fasterxml.jackson.annotation.JsonIgnore;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@ToString
public class User {
    @NotNull
    private Integer id;
    private String username;
    @JsonIgnore//SpringMVC将当前对象转换成字符串时,忽略password
    private String password;

    @NotEmpty
    @Pattern(regexp ="^\\S{1,10}$")
    private String nickname;
    @NotEmpty
    @Email
    private String email;
    private Long createTime;
    private Long updateTime;

}
